Ext.define('DDMS.controller.DomainTab', {
    extend: 'Ext.app.Controller',
    config: {
        refs: {
            domainTabCmp: '#domainTab'
        },

        control: {
        	domainTabCmp: {
        	  activeitemchange: 'domainTabCmpActivate'
        	}
        }
    },
    domainTabCmpActivate: function( obj, value, oldValue, eOpts ) {
    	var tabBarTitle=obj.getTabBar().getActiveTab().getTitle();
    	var toolbar=Ext.getCmp('domainTab-toolbar');
    	
    	if (tabBarTitle=='公开招标'||tabBarTitle=='单一来源'||tabBarTitle=='竞争性谈判'){
    		toolbar.setHidden( false );
    		toolbar.setTitle(tabBarTitle);
    	} else{
    		toolbar.setHidden( true );
    	}
    }
});